#ifndef HD_FILE_SYS_H
#define HD_FILE_SYS_H



#define FOLLOW_SYMB_LINKS FLAG_(1)

#define FOLLOW_SUBDIRS FLAG_(2)

#define MATCH_PATTERN FLAG_(3)

/* FLAG_(32) is RESERVED */


typedef struct fs_attr file_sys_attr, *file_sys_attr_t;
typedef struct fs file_sys, *file_sys_t;

struct fs_attr {
  int flags;
  off_t min_file_size;
  off_t max_file_size;
  unsigned int max_depth;
  char *pattern;
};
struct fs {
  char* dir;
  DIR* dip;
  file_sys_attr_t attr;
  struct dirent *curr;
  unsigned int depth;
  struct fs *child;
};
#define FS_ATTR_SIZE (sizeof(file_sys_attr))



#define FS_SIZE (sizeof(file_sys))




void create_default_attr(file_sys_attr_t res);


int init_file_sys(file_sys_t buf, char* dir, file_sys_attr_t attr);
char *get_next_file(file_sys_t e);
void close_file_sys(file_sys_t e);

#endif
